feat(telemetry): add disk I/O instrumentation utility#25745
Merged
technicallyty merged 10 commits intomainfrom Jan 22, 2026
Merged
feat(telemetry): add disk I/O instrumentation utility#25745technicallyty merged 10 commits intomainfrom
technicallyty merged 10 commits intomainfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #25745 +/- ##
==========================================
- Coverage 70.84% 66.50% -4.34%
==========================================
Files 890 929 +39
Lines 58024 60221 +2197
==========================================
- Hits 41106 40051 -1055
- Misses 16918 20170 +3252
🚀 New features to boost your workflow:
|
Comment on lines
95
to
125
| for device, s := range stats { | ||
| attrDevice := systemconv.DiskIO{}.AttrDevice(device) | ||
|
|
||
| // system.disk.io (bytes read/written) | ||
| o.ObserveInt64(diskIO, int64(s.ReadBytes), | ||
| metric.WithAttributes(attrDevice, attrDirectionRead)) | ||
| o.ObserveInt64(diskIO, int64(s.WriteBytes), | ||
| metric.WithAttributes(attrDevice, attrDirectionWrite)) | ||
|
|
||
| // system.disk.operations (read/write counts) | ||
| o.ObserveInt64(diskOps, int64(s.ReadCount), | ||
| metric.WithAttributes(attrDevice, attrDirectionRead)) | ||
| o.ObserveInt64(diskOps, int64(s.WriteCount), | ||
| metric.WithAttributes(attrDevice, attrDirectionWrite)) | ||
|
|
||
| // system.disk.io_time (seconds) - gopsutil returns milliseconds | ||
| o.ObserveFloat64(diskIOTime, float64(s.IoTime)/1000.0, | ||
| metric.WithAttributes(attrDevice)) | ||
|
|
||
| // system.disk.operation_time (seconds) - gopsutil returns milliseconds | ||
| o.ObserveFloat64(diskOpTime, float64(s.ReadTime)/1000.0, | ||
| metric.WithAttributes(attrDevice, attrDirectionRead)) | ||
| o.ObserveFloat64(diskOpTime, float64(s.WriteTime)/1000.0, | ||
| metric.WithAttributes(attrDevice, attrDirectionWrite)) | ||
|
|
||
| // system.disk.merged (merged read/write operations) | ||
| o.ObserveInt64(diskMerged, int64(s.MergedReadCount), | ||
| metric.WithAttributes(attrDevice, attrDirectionRead)) | ||
| o.ObserveInt64(diskMerged, int64(s.MergedWriteCount), | ||
| metric.WithAttributes(attrDevice, attrDirectionWrite)) | ||
| } |
Check warning
Code scanning / CodeQL
Iteration over map
| metric.WithAttributes(attrDevice, attrDirectionWrite)) | ||
|
|
||
| // system.disk.io_time (seconds) - gopsutil returns milliseconds | ||
| o.ObserveFloat64(diskIOTime, float64(s.IoTime)/1000.0, |
Check notice
Code scanning / CodeQL
Floating point arithmetic
| metric.WithAttributes(attrDevice)) | ||
|
|
||
| // system.disk.operation_time (seconds) - gopsutil returns milliseconds | ||
| o.ObserveFloat64(diskOpTime, float64(s.ReadTime)/1000.0, |
Check notice
Code scanning / CodeQL
Floating point arithmetic
| // system.disk.operation_time (seconds) - gopsutil returns milliseconds | ||
| o.ObserveFloat64(diskOpTime, float64(s.ReadTime)/1000.0, | ||
| metric.WithAttributes(attrDevice, attrDirectionRead)) | ||
| o.ObserveFloat64(diskOpTime, float64(s.WriteTime)/1000.0, |
Check notice
Code scanning / CodeQL
Floating point arithmetic
technicallyty
approved these changes
Jan 7, 2026
Contributor
|
can we merge this? |
This comment has been minimized.
This comment has been minimized.
warpbuild-benchmark-bot bot
added a commit
to WarpBuilds/cosmos-sdk
that referenced
this pull request
Jan 22, 2026
Cordtus
pushed a commit
to Cordtus/cosmos-sdk
that referenced
this pull request
Feb 3, 2026
Co-authored-by: Alex | Cosmos Labs <alex@cosmoslabs.io> Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes: #XXXX
This adds OpenTelemetry disk I/O instrumentation using https://pkg.go.dev/github.com/shirou/gopsutil/v4@v4.25.12/disk following the semantic conventions specified in https://opentelemetry.io/docs/specs/semconv/system/system-metrics/ and copying the code patterns in https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/runtime as much as possible.
It also adds a
cosmos_extraconfig optioninstrument_disk_ioto enable this inotel.yaml.